Skip to content

Refactor Condition.Stats and DirectoryFileTransferTracker.Stats with Builder pattern#19862

Merged
sandeshkr419 merged 4 commits intoopensearch-project:mainfrom
pado0:builder-condition-directory-stats
Nov 7, 2025
Merged

Refactor Condition.Stats and DirectoryFileTransferTracker.Stats with Builder pattern#19862
sandeshkr419 merged 4 commits intoopensearch-project:mainfrom
pado0:builder-condition-directory-stats

Conversation

@pado0
Copy link
Contributor

@pado0 pado0 commented Nov 1, 2025

Description

This PR refactors the Condition.Stats and DirectoryFileTransferTracker.Stats class to use the Builder pattern instead of relying on multiple constructors.

By adopting the Builder pattern, it becomes easier to evolve the stats API, add new metrics, and maintain backward compatibility without forcing disruptive constructor changes.

Based on the related issue:

  1. Added a Builder and deprecated the existing constructors.
  2. Replaced usages of constructors in code and tests with the new Builder.

There are multiple stats-related classes that need similar refactoring, and we are addressing them in priority order. This PR covers Condition.Stats and DirectoryFileTransferTracker.Stats as part of that effort.

Related Issues

Related to #19225

Check List

  • Functionality includes testing.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

❌ Gradle check result for d34b9e7: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@pado0 pado0 force-pushed the builder-condition-directory-stats branch from d34b9e7 to bdcb3cd Compare November 1, 2025 18:15
@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

❌ Gradle check result for bdcb3cd: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

❌ Gradle check result for 0158f39: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@pado0 pado0 closed this Nov 1, 2025
@pado0 pado0 reopened this Nov 1, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

✅ Gradle check result for 8968d2d: SUCCESS

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

❕ Gradle check result for 82a6b4b: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

pado0 added 3 commits November 3, 2025 23:02
Signed-off-by: Jean Kim <bgshhd95@gmail.com>
Signed-off-by: Jean Kim <bgshhd95@gmail.com>
Signed-off-by: Jean Kim <bgshhd95@gmail.com>
@pado0 pado0 force-pushed the builder-condition-directory-stats branch from 82a6b4b to f427ebb Compare November 4, 2025 07:02
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

✅ Gradle check result for f427ebb: SUCCESS

@pado0
Copy link
Contributor Author

pado0 commented Nov 7, 2025

I'll work on the next Stats class once comments are resolved and this PR is merged!

@sandeshkr419 sandeshkr419 reopened this Nov 7, 2025
Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

❌ Gradle check result for 78938ec: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

❌ Gradle check result for 78938ec: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

✅ Gradle check result for 78938ec: SUCCESS

@sandeshkr419 sandeshkr419 merged commit 51aa21a into opensearch-project:main Nov 7, 2025
35 of 39 checks passed
@pado0 pado0 deleted the builder-condition-directory-stats branch November 8, 2025 22:02
liuguoqingfz pushed a commit to liuguoqingfz/OpenSearch that referenced this pull request Dec 15, 2025
…Builder pattern (opensearch-project#19862)

Co-authored-by: Sandesh Kumar <sandeshkr419@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants